package cn.hit.tianqiao.domain;

import java.sql.Timestamp;
import cn.hit.tianqiao.util.UuidUtil;

public class Reservation {

    private Long id;

    private String userName;

    private String userPhone;

    private String userNote;

    private Integer eventId;

    private Timestamp createTime;

    private String reservationNumber; // 新增的六位预约编号字段

    // Constructors
    public Reservation() {
        // Default constructor for JPA
        this.reservationNumber = UuidUtil.getSixDigitUuid(); // 通过工具类生成六位数的随机字符串
    }

    public Reservation(String userName, String userPhone, String userNote, Integer eventId) {
        this.userName = userName;
        this.userPhone = userPhone;
        this.userNote = userNote;
        this.eventId = eventId;
        this.createTime = new Timestamp(System.currentTimeMillis());
        this.reservationNumber = UuidUtil.getSixDigitUuid(); // 通过工具类生成六位数的随机字符串
    }

    // Getters and Setters
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getUserPhone() {
        return userPhone;
    }

    public void setUserPhone(String userPhone) {
        this.userPhone = userPhone;
    }

    public String getUserNote() {
        return userNote;
    }

    public void setUserNote(String userNote) {
        this.userNote = userNote;
    }

    public Integer getEventId() {
        return eventId;
    }

    public void setEventId(Integer eventId) {
        this.eventId = eventId;
    }

    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    public String getReservationNumber() {
        return reservationNumber;
    }

    public void setReservationNumber(String reservationNumber) {
        this.reservationNumber = reservationNumber;
    }
}